function logout() {
  const domainName = `${window.location.protocol}//${window.location.host}`
  const loginUrl = `/orgDev/rz/index.html?appid=${
    process.env.VUE_APP_APPID
  }${encodeURIComponent('&')}agentid=${process.env.VUE_APP_AGENTID}`
  if (!window.location.pathname.includes(loginUrl)) {
    // window.location.href = `/_tif_logout?returnUrl=${loginUrl}?redirect=${encodeURIComponent(
    //   window.location.pathname + window.location.search
    // )}`

    const firstUrl = encodeURIComponent(`${domainName}/_tif_wwlocal_login_/`)

    const secondUrl = `${domainName}${window.location.pathname}${window.location.search}`
    const enCodeSecondUrl = encodeURIComponent(encodeURIComponent(secondUrl))

    window.location.href = `/_tif_logout?returnUrl=${loginUrl}${encodeURIComponent(
      '&'
    )}redirect_uri=${encodeURIComponent(firstUrl)}?url=${encodeURIComponent(
      enCodeSecondUrl
    )}${encodeURIComponent('&')}state=ioc`
  }
}
export { logout }
